/**
 * edurender
 * FullScreenQuad.h
 * (c) 2009 J. Brad Byrd
 */

#ifndef ER_FULLSCREENQUAD_H
#define ER_FULLSCREENQUAD_H

#include "DXUT.h"

namespace er
{
	class FullScreenQuad
	{
	public:
		static FullScreenQuad *Create(ID3D10Device *device);
		static void Destroy(FullScreenQuad *quad);
		
	public:
		void SetTexture(ID3D10Texture2D *texture);
		void Draw();

	private:
		struct Vertex
		{
			D3DXVECTOR2 position;
			D3DXVECTOR2 texCoord;
		};

	private:
		FullScreenQuad(ID3D10Device *device);
		~FullScreenQuad();
		bool Initialize();
	
	private:
		ID3D10Device *m_device;
		ID3D10Buffer *m_vb;
		ID3D10Effect *m_effect;
		ID3D10InputLayout *m_layout;
		ID3D10Texture2D *m_texture;
		ID3D10ShaderResourceView *m_srv;
	
	private:
		FullScreenQuad(const FullScreenQuad &);
		FullScreenQuad &operator=(const FullScreenQuad &);
	};
}

#endif // ER_FULLSCREENQUAD_H
